#include <iostream>
#include <boost/filesystem.hpp>
#include "common/logger.h"
#include "network/server.h"

using namespace std;

int main(int argc, char** argv)
{
	if (argc <2)
	{
		boost::filesystem::path path(argv[0]);		
		cerr << "Usage: " << path.filename() << " log4cplus.conf" << endl;
		exit(-1);
	}

#ifdef WIN32
	WSADATA wsaData;
	WSAStartup(MAKEWORD(2, 2), &wsaData);
#endif

	CLogger::init(argv[1]);
	LOG4CPLUS_DEBUG(Log, "test");
	
	std::string port("8900");
	Server server(port);
	server.start();

	system("pause");
#ifdef WIN32
	WSACleanup();
#endif
	return 0;
}
